<?php

	$http = new Swoole\Http\Server('0.0.0.0', 7777);
	
	$http->set([
		'task_worker_num' => 10
	]);
	
	$http->on('request', function ($request, $response) use($http) {
		var_dump('bbb');
		$response->end('ac');
		
		$http->task('abcd');
		
		/* var_dump($request->rawContent());
		var_dump($request);
		return 33; */
	});
	
    $http->on('WorkerStart', function (swoole_server $server, int $worker_id) use($http) {
        if($worker_id == 0){
            var_dump('start');
        }
	});
	
	$http->on('Task', function (swoole_server $serv, $task_id, $src_worker_id, $data) {
	    var_dump('task:' . $src_worker_id);
		
		return true;
	});
	
	$http->on('Finish', function (swoole_server $serv, $task_id, $data) {
		return true;
	});
	
	$http->start();